<div class="sectionheader">
	<table id="result_table" name="result_table" class="result">
		<thead>
			<tr>
				<th></th>
				<th class="ta-left">Title</th>
				<th class="ta-left">Start</th>
				<th class="ta-left">Content</th>
				<th class="ta-left">Where</th>
				<th class="num-col">Rate</th>
				<th class="num-col">Hours</th>
				<th class="num-col">Fee</th>
				<th class="num-col">Payment</th>
				<th class="ta-right"><div class="closeButton" onclick='javascript:clearResults();'><img src="/images/close.gif"></div></th>
			</tr>
			<tr>
				<th class="ta-left cb-col"><input type="checkbox" id='toggle_checks' name='toggle_checks' onclick='javascript:toggleChecks();'/></th>
				<th class="menuitem" colspan=8>
					Mark: 
					<span class="menuitem"><a href="javascript:markPaid(true);">Paid</a></span>,
					<span class="menuitem"><a href="javascript:markPaid(false);">Unpaid</a></span>
					&nbsp;&nbsp;		
					<FORM action="/statement" method="post" target="_blank" onsubmit="return jsonifyStatement('jsonStatement')" style="display:inline">
						<span class="menuitem">
						<INPUT type="text" name="jsonStatement" id="jsonStatement" style="display:none">
					    <INPUT type="submit" value="Invoice"> 
						</span>			
					</FORM>
					<span class="menuitem"><a href="javascript:toggle('export')">Export &raquo;</a></span>
					<div id="export" style="display:none">
						<FORM action="/download" method="post" onsubmit="return jsonifyStatement('jsonExport')" style="display:inline">
							<span class="menuitem">
							<INPUT type="text" name="jsonExport" id="jsonExport" style="display:none">
					    	<select name="downloadFormat" id="downloadFormat" size="1">
								<option selected="CSV" value="CSV">CSV</option>
								<option value="XML">XML</option>
							</select>
						    <INPUT type="submit" value="Download"> 
							<INPUT type="button" onclick="toggle('export')" value="Cancel"/>
							</span>			
						</FORM>
					</div>	
				</th>
				<th class="menuitem"></th>
			</tr>
		</thead>
		<tbody>
			{% for ce in result_list %}
			<tr class="{% cycle row-odd,row-even %}">
				<td class="list-row" ><input type="checkbox" />
				<td class="list-row"> {{ ce.title }} </td>
				<td class="list-row"> {{ ce.start_time }} </td>
				<td class="list-row"> {{ ce.content_stripped }} </td>
				<td class="list-row"> {{ ce.where }} </td>				
				<td class="list-row num-col"> {{ ce.rate }} </td>
				<td class="list-row num-col"> {{ ce.duration }} </td>
				<td class="list-row num-col fee"> {{ ce.fee }} </td>	
				<td class="list-row num-col payment" onclick="onClickEdit(this);"> {{ ce.payment }} </td>
				<td class="list-row"></td>						
			</tr>
			{% endfor %}
			<tr>
				<td colspan=6 class="ta-right">TOTAL</td>
				<td id="total_hours" class="total-row num-col "> {{ total_list.0 }}</td>
				<td id="total_fees" class="total-row num-col "> {{ total_list.1 }}</td>
				<td id="total_payments" class="total-row num-col "> {{ total_list.2 }}</td>
				<td></td>
				<td></td>
				<td></td>
			</tr>
		</tbody>
	</table>
<div>
